package com.heifei.day04

/**
 * @author caizhengjun
 * @date 2020/8/7 8:29 下午
 */
object ReduceDemo {

  def main(args: Array[String]): Unit = {

    val intList: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7, 8, 9)

    //val sum: Int = intList.reduce(_ + _)
    //println(sum)


    val i = intList.fold(100)(_ + _)
    println(i)
  }

}
